import com.beans.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-10-01
 * Time: 11:08
 */

public class App {
    public static void main(String[] args) {
        System.out.println("你好 spring");
        //1.得到spring上下文
        ApplicationContext context =
                new ClassPathXmlApplicationContext("spring-config.xml");

        //2.根据上下文对象提供的方法获取到Bean
        User user = (User) context.getBean("user");

        //3.使用
        user.sayHi("张三");

    }
}
